<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>SerialPort.pb</title></head>
<body bgcolor="#FFFFDF" link="#009999" vlink="#006666" alink="#006666">
<pre><font face="Courier New, Courier, mono"size="2"><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font><font color="#006666">;   PureBasic - SerialPort example file
</font><font color="#006666">;
</font><font color="#006666">;    (c) Fantaisie Software
</font><font color="#006666">;
</font><font color="#006666">; ------------------------------------------------------------
</font><font color="#006666">;
</font>
<b><font color="#006666">CompilerIf</font></b> <font color="#924B72">#PB_Compiler_OS</font> = <font color="#924B72">#PB_OS_Windows</font>
  Port$ = "COM1"
<b><font color="#006666">CompilerElse</font></b>
  Port$ = "/dev/ttyS0"
<b><font color="#006666">CompilerEndIf</font></b>

<b><font color="#006666">If</font></b> <font color="#006666">OpenSerialPort</font>(0, Port$, 300, <font color="#924B72">#PB_SerialPort_NoParity</font>, 8, 1, <font color="#924B72">#PB_SerialPort_NoHandshake</font>, 1024, 1024)

<font color="#006666">	MessageRequester</font>("Information", "SerialPort opened with success")

<b><font color="#006666">Else</font></b>
<font color="#006666">	MessageRequester</font>("Error", "Can't open the serial port: "+Port$)
<b><font color="#006666">EndIf</font></b>
</font></pre>
</body></html>
